package com.zhu

import scala.util.control.Breaks

/**
 *
 * @version 1.0
 * @author study
 * @date 2020/9/2 21:56
 *
 */
object Scala05_dataType {
  def main(args: Array[String]): Unit = {
    var b: Byte = 10
    var c: Char = 'a'
    println(c)

    val unit = m1(1)
    println(unit)
    //强制类型转换
    val int = 10.2.toInt

    //数值 -->字符串
    var n = 1 + ""

    "12".toInt

    //会报错
    val toInt = "12.3".toInt
    println(toInt)

    for (i: Int <- 1 to 10) {
      println(i)
    }

  }

  def m1(n: Int) = {
    println("m1被执行了")

    for (i <- 1 to 10) {
      if (i == 3) {
        Breaks.break()
      }
    }
  }
}
